Developer Documentation

QuickTime 4 API Documentation

Inside Macintosh: QuickTime Components

Previous | Overview | Contents | Next |

Managing the Time

Clock components provide several functions that allow the Movie Toolbox to alert your component to changes in its environment. Three of these functions, ClockTimeChanged , ClockRateChanged , and ClockStartStopChanged , are associated with application callback functions and help your component determine whether to invoke the callback function. The fourth, the ClockSetTimeBase function, tells your clock component about the time base it is supporting.

ClockTimeChanged

The Movie Toolbox calls your component's ClockTimeChanged function whenever the callback's time base time value is set. The Movie Toolbox calls this function only if the qtcbNeedsTimeChanges flag is set to 1 in the callBackFlags field of the QuickTime callback header structure allocated by your clock component (see "Data Type," for more information).

pascal ComponentResult ClockTimeChanged
                                         (ComponentInstance aClock,
                                          QTCallBack cb);

aClock
Specifies the clock for the operation. Applications obtain this identifier from the Component Manager's OpenComponent function.

cb
Specifies the callback for the operation. The Movie Toolbox obtains this value from your component's ClockNewCallBack function.

DESCRIPTION

The Movie Toolbox calls this function once for each qualified callback function associated with the time base. Note that the Movie Toolbox calls this function only for callback events that are currently scheduled.

ClockRateChanged

The Movie Toolbox calls your component's ClockRateChanged function whenever the callback's time base rate changes. The Movie Toolbox calls this function only if the qtcbNeedsRateChanges flag is set to 1 in the callBackFlags field of the callback header structure in the QTCallBackHeader structure allocated by your clock component (see "Data Type," for more information about the callback header structure).

pascal ComponentResult ClockRateChanged (ComponentInstance aClock,
                                          QTCallBack cb);

aClock
Specifies the clock for the operation. Applications obtain this identifier from the Component Manager's OpenComponent function.

cb
Specifies the callback for the operation. The Movie Toolbox obtains this value from your component's ClockNewCallBack function (described on ClockNewCallBack ).

DESCRIPTION

The Movie Toolbox calls this function once for each qualified callback function associated with the time base. Note that the Movie Toolbox calls this function only for callback events that are currently scheduled.

ClockStartStopChanged

The Movie Toolbox calls your component's ClockStartStopChanged function whenever the start or stop time of the callback's time base changes. The Movie Toolbox calls this function only if the qtcbNeedsStartStop flag is set to 1 in the callBackFlags field of the callback header structure in the QTCallBackHeader structure allocated by your clock component (see "Data Type," for more information about the callback header structure).

pascal ComponentResult ClockStartStopChanged
                                         (ComponentInstance aClock, QTCallBack cb,
                                          Boolean startChanged,
                                          Boolean stopChanged);

aClock
Specifies the clock for the operation. Applications obtain this identifier from the Component Manager's OpenComponent function.

cb
Specifies the callback for the operation. The Movie Toolbox obtains this value from your component's ClockNewCallBack function (described on ClockNewCallBack ).

startChanged
Indicates that the start time of the time base associated with the clock component instance has changed.

stopChanged
Indicates that the stop time of the time base associated with the clock component instance has changed.

DESCRIPTION

The Movie Toolbox calls this function once for each qualified callback function associated with the time base. Note that the Movie Toolbox calls this function only for callback events that are currently scheduled.

ClockSetTimeBase

The Movie Toolbox calls your component's ClockSetTimeBase function when an application creates a time base that uses your clock component. The tb parameter indicates the time base that is associated with your clock.

pascal ComponentResult ClockSetTimeBase (ComponentInstance aClock,
                                          TimeBase tb);

aClock
Specifies the clock for the operation. Applications obtain this identifier from the Component Manager's OpenComponent function.

tb
Specifies the time base that is associated with the clock.

DESCRIPTION

Your clock component may need to know its time base if the rate or time value of the time base can be changed without using Movie Toolbox functions. This could be the case if your clock supports an external clock. Under these circumstances, the Movie Toolbox cannot use the ClockRateChanged and ClockTimeChanged functions (described on ClockRateChanged and ClockTimeChanged , respectively) to alert your component to changes in its environment. Instead, your component can use the time base provided here to seed the GetFirstCallBack function, described on GetFirstCallBack , and then scan all its associated callback functions.


© 1999 Apple Computer, Inc.

Previous | Overview | Contents | Next